<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>错误 - 徒步路线分享平台</title>
    <style>
        :root {
            --primary-color: #4a6fa5;
            --error-color: #e74c3c;
            --light-color: #f8f9fa;
            --dark-color: #343a40;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
            line-height: 1.6;
            color: var(--dark-color);
            background-color: var(--light-color);
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        .error-container {
            max-width: 800px;
            margin: auto;
            padding: 2rem;
            text-align: center;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .error-icon {
            font-size: 5rem;
            color: var(--error-color);
            margin-bottom: 1.5rem;
        }

        h1 {
            font-size: 2.5rem;
            margin-bottom: 1rem;
            color: var(--error-color);
        }

        .error-code {
            font-size: 1.2rem;
            font-weight: bold;
            margin-bottom: 1.5rem;
            opacity: 0.7;
        }

        p {
            font-size: 1.1rem;
            margin-bottom: 2rem;
            color: #555;
        }

        .actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .btn {
            display: inline-block;
            padding: 0.8rem 1.5rem;
            border-radius: 4px;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s ease;
        }

        .btn-primary {
            background-color: var(--primary-color);
            color: white;
        }

        .btn-primary:hover {
            background-color: #3a5a8a;
            transform: translateY(-2px);
        }

        .btn-secondary {
            border: 1px solid var(--primary-color);
            color: var(--primary-color);
        }

        .btn-secondary:hover {
            background-color: #f0f0f0;
        }

        footer {
            text-align: center;
            padding: 1.5rem;
            color: #666;
            font-size: 0.9rem;
        }

        @media (max-width: 600px) {
            .error-container {
                padding: 1rem;
            }

            h1 {
                font-size: 2rem;
            }

            .error-icon {
                font-size: 4rem;
            }
        }
    </style>
</head>
<body>
    <div class="error-container">
        <div class="error-icon">⚠️</div>
        <h1>{{ message }}</h1>

        {% if error_code %}
        <div class="error-code">错误代码: {{ error_code }}</div>
        {% endif %}

        <p>
            抱歉，处理您的请求时出现了问题。<br>
            请稍后再试或联系管理员获取帮助。
        </p>

        <div class="actions">
            <a href="{{ url_for('hikes.index') }}" class="btn btn-primary">
                <span>返回首页</span>
            </a>
            <a href="mailto:support@example.com" class="btn btn-secondary">
                <span>联系支持</span>
            </a>
        </div>
    </div>

    <footer>
        &copy; {{ now.year }} 徒步路线分享平台 - 保留所有权利
    </footer>
</body>
</html>